<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<!DOCTYPE html>

<html>
<head>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<jsp:include page="/core/tool/resources.jsp"></jsp:include>

</head>

<body>
	<div id="toolbar">
       <a class="easyui-linkbutton" iconCls='icon-save' onclick="$('#dg').edatagrid('saveRow')" >保存</a>
       <a class="easyui-linkbutton" iconCls='icon-save' onclick="click_copy()" >默认</a>
       <a class="easyui-linkbutton" iconCls="icon-reload" onclick="$('#dg').edatagrid('reload')">刷新</a>
       <a class="easyui-linkbutton" iconCls="icon-undo" onclick="$('#dg').edatagrid('cancelRow')">取消</a>
	</div>
	<table id="dg" class="easyui-edatagrid" toolbar="#toolbar"
		data-options="rownumbers:true,singleSelect:true,pagination:false,method:'post',idField:'feeId',
				remoteSort:false,multiSort:true,sortName:'exchange,tradeType',sortOrder:'asc,asc',
				fit:true, fitColumns:true,
				autoSave:true, editing:true,
				url : './feeQuery.json',
				saveUrl:'./feeSave.json', updateUrl:'./feeSave.json'" 
			>
        <thead>
            <tr>
            	<th data-options="field:'feeId',width:10,hidden:true,rowspan:2">主键</th>
            	<th data-options="field:'exchange',width:80,sortable:true,rowspan:2, formconfig:{type:'combobox',options:{flexset:'SMDC_EXCHANGE'}}">证券市场</th>
                <th data-options="field:'tradeType',width:80,sortable:true,rowspan:2,formconfig:{type:'combobox',options:{flexset:'TRADE_TYPE'}}">交易类型</th>
				<th data-options="field:'feeCommision',colspan:4,align:'center'">佣金</th>
                <th data-options="field:'feeTax',colspan:4,align:'center'">印花税</th>           
                <th data-options="field:'feeOther',colspan:4,align:'center'">其它费</th>
            </tr>
            <tr>
				<th data-options="field:'feeCommisionBase',width:80, editor:{type:'combobox',options:{flexset:'TRADE_FEE_BASE'}}">基础</th>
                <th data-options="field:'feeCommisionRate',width:80, editor:{type:'numberbox',options:{precision:3,suffix:'%'}}">费率(%)</th>
                <th data-options="field:'feeCommisionMin',width:60, editor:{type:'numberbox',options:{precision:2}}">最小</th>
                <th data-options="field:'feeCommisionMax',width:60, editor:{type:'numberbox',options:{precision:2}}">最大</th>
                <th data-options="field:'feeTaxBase',width:80, editor:{type:'combobox',options:{flexset:'TRADE_FEE_BASE'}}">基础</th>
                <th data-options="field:'feeTaxRate',width:80, editor:{type:'numberbox',options:{precision:3,suffix:'%'}}">费率(%)</th>
                <th data-options="field:'feeTaxMin',width:60, editor:{type:'numberbox',options:{precision:2}}">最小</th>
                <th data-options="field:'feeTaxMax',width:60, editor:{type:'numberbox',options:{precision:2}}">最大</th>               
                <th data-options="field:'feeOtherBase',width:80, editor:{type:'combobox',options:{flexset:'TRADE_FEE_BASE'}}">基础</th>
                <th data-options="field:'feeOtherRate',width:80, editor:{type:'numberbox',options:{precision:4,suffix:'%'}}">费率(%)</th>
                <th data-options="field:'feeOtherMin',width:60, editor:{type:'numberbox',options:{precision:2}}">最小</th>
                <th data-options="field:'feeOtherMax',width:60, editor:{type:'numberbox',options:{precision:2}}">最大</th>
            </tr>
        </thead>
    </table>
</body>

<script type="text/javascript">
	function click_copy() {
		$.messager.confirm('确认','您确认想要恢复默认设置？',function(r){    
		    if (r){    
		    	$.post(
				"./copy.json",	
			 	function (data){
					$('#dg').datagrid('loadData',data);
				}
			);
	    }});
	}
</script>

</html>



